package org.onvivals.module.ums.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.*;
import org.onvivals.common.base.BaseEntity;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户账单表
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("ums_user_bill")
@Schema( description = "UmsUserBill对象")
public class UmsUserBill extends BaseEntity<UmsUserBill> {

	@Serial
	private static final long serialVersionUID = 1L;

    /**
     * 用户账单id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description="用户账单id")
    private Long id;

    /**
     * 用户uid
     */
    @TableField(value = "`uid`")
    @Schema(description="用户uid")
    private Long uid;

    /**
     * 关联id
     */
    @TableField(value = "link_id")
    @Schema(description="关联id")
    private String linkId;

    /**
     * 0 = 支出 1 = 获得
     */
    @TableField(value = "pm")
    @Schema(description="0 = 支出 1 = 获得")
    private Integer pm;

    /**
     * 账单标题
     */
    @TableField(value = "title")
    @Schema(description="账单标题")
    private String title;

    /**
     * 明细种类
     */
    @TableField(value = "category")
    @Schema(description="明细种类")
    private String category;

    /**
     * 明细类型
     */
    @TableField(value = "`type`")
    @Schema(description="明细类型")
    private String type;

    /**
     * 明细数字
     */
    @TableField(value = "`number`")
    @Schema(description="明细数字")
    private BigDecimal number;

    /**
     * 剩余
     */
    @TableField(value = "balance")
    @Schema(description="剩余")
    private BigDecimal balance;

    /**
     * 备注
     */
    @TableField(value = "mark")
    @Schema(description="备注")
    private String mark;

    /**
     * 0 = 带确定 1 = 有效 -1 = 无效
     */
    @TableField(value = "`status`")
    @Schema(description="0 = 带确定 1 = 有效 -1 = 无效")
    private Boolean status;

	@Schema(description= "会员到期时间")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date vipExpireTime;

	@TableField(exist = false)
	private boolean isExpire;

	@TableField(exist = false)
	private long day;

	@TableField(exist = false)
	private String nickname;

}
